<?php
    session_start();
    $ResultStr ='asdf';
    $NewImage =imagecreatefromjpeg($_SERVER['DOCUMENT_ROOT']."/LelangIT/image/img.jpg");//image create by existing image and as back ground

    $LineColor = imagecolorallocate($NewImage,233,239,239);//line color
    $TextColor = imagecolorallocate($NewImage, 0, 0, 0);//text color-white

    imageline($NewImage,1,1,40,40,$LineColor);//create line 1 on image
    imageline($NewImage,1,100,60,0,$LineColor);//create line 2 on image
    imageline($NewImage,5, 1, 200, 50, $LineColor);

    imagestring($NewImage, 5, 10, 5, $ResultStr, $TextColor);// Draw a random string horizontally

    //header("Content-type: image/jpeg");// out out the image
    imagejpeg($NewImage);//Output image to browser
 ?>